package com.gsafety.wellsfort.domain.vo;

import com.gsafety.wellsfort.domain.PageQuery;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author tangjiawei
 * @date 2020/04/15
 */
@Data
public class QueryVO {
    @ApiModelProperty(value = "当前页码", required = false)
    private Integer pageNo = PageQuery.DEFAULT_PAGE_NO;
    @ApiModelProperty(value = "分页大小", required = false)
    private Integer pageSize = PageQuery.DEFAULT_PAGE_SIZE;
    @ApiModelProperty(value = "排序字段", required = false)
    private String orderBy = new String("created");
    @ApiModelProperty(value = "排序:asc 升序,desc 降序", required = false)
    private String sortType = new String("desc");

    public int getStartIndex() {
        int startIndex = (this.pageNo - 1) * this.pageSize;
        return startIndex;
    }
}
